package com.crm.controller;

import com.crm.commons.domain.ResponseData;
import com.crm.entity.CrmDataValue;
import com.crm.service.ICrmDataValueService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author junxian,dou
 * @since 2024-11-25
 */
@RestController
@RequestMapping("/crmDataValue")
public class CrmDataValueController {

    @Resource
    private ICrmDataValueService dataValueService;

    /**
     * 根据code查询类型
     * @param codeName
     * @return
     */
    @GetMapping("/getDataVluesByCode/{codeName}")
    public ResponseData getDataVluesByCode(@PathVariable String codeName){
        List<CrmDataValue> dataValues = dataValueService.getDataVluesByCode(codeName);
        return ResponseData.success(dataValues);
    }

}
